import http from '../utils/http'

/* 登录接口 */
export const reqLogin = (code) => {
  return http.get(`/user/log?code=${code}`)
}

/* 用户注册 */
export const reqRegister = (data) => {
  return http.post('/user/register', data)
}

/* 用户获取消息 */
export const reqGetInfo = () => {
  return http.get('/user/getInformation')
}

/* 用户修改信息 */
export const reqUpdate = (data) => {
  return http.put('/user/update', data)
}

/* 用户修改昵称 */
export const reqUpdateName = (wxName) => {
  return http.get(`/user/updateWxName?wxName=${wxName}`)
}

/* 用户上传头像 */
export const uploadAvatar = (data) => {
  return http.post('/user/upload', data)
}

/* 获取用户当前的考核 */
export const reqCurTest = (testId) => {
  return http.get(`/wx/test/get/current?testId=${testId}`)
}

/* 获取用户所在组别的考核流程 */
export const reqCurProgress = () => {
  return http.get('/wx/test/get/all')
}

/* 判断用户是否已经报名 */
export const reqIsRegister = () => {
  return http.get('/user/isRegister')
}